FROM openjdk:11-jdk-alpine

LABEL maintainer="Boolean <hongbin.hsu@bincent.com>"

#更换aline源 && update apk
RUN sed -i 's/dl-cdn.alpinelinux.org/mirrors.ustc.edu.cn/g' /etc/apk/repositories \
    && apk update && apk upgrade \
    && apk add --no-cache --virtual .build-deps tzdata ca-certificates \
    && cp -r -f /usr/share/zoneinfo/Asia/Shanghai /etc/localtime \
    && echo "Asia/Shanghai" > /etc/timezone \
    && apk del --purge --progress .build-deps tzdata

VOLUME /tmp

COPY target/fastapi-0.0.1-SNAPSHOT.jar app.jar

RUN bash -c 'touch /app.jar'

EXPOSE 8080

ENTRYPOINT ["java","-Djava.security.egd=file:/dev/./urandom","-jar","/app.jar"]